{template nheader.html}
<div class="page-bar">
	<ul class="page-breadcrumb">
		<li><a href="{dr_url('check/'.$action)}" class="blue"> <i class="icon-compass"></i> {fc_lang('检测结果')}</a> <i class="fa fa-circle"></i></li>
		<li><a href="{dr_url('check/phpinfo')}" target="_blank"> <i class="fa fa-pie-chart"></i> {fc_lang('PHP环境')}</a></li>
	</ul>
</div>

<h3 class="page-title">
	<small>绿色部分表示正常配置，红色部分表示推荐处理。</small>
</h3>

<div class="portlet light bordered">
	<div class="portlet-body">
		<div class="table-list">
			<table class="mytable table table-striped table-bordered table-hover table-checkable dataTable">
				<thead>
				<tr>
					<th width="20"></th>
					<th  width="220">{fc_lang('检查项')}</th>
					<th>{fc_lang('结果')}</th>
				</tr>
				</thead>
				<tbody>
				{php $c=1;}
				{loop $step $i $t}
				<tr>
					<td><span class="badge badge-success">{php echo $c;$c++;}</span></td>
					<td>{$t}</td>
					<td id="dr_result{$i}">
						<img src="{THEME_PATH}admin/images/loading-mini.gif">
					</td>
				</tr>
				{/loop}
				<tr>
					<td>
						<span class="badge badge-success"> {$c+1} </span>
					</td>
					<td>
						{fc_lang('扫描Bom非法字符串')}
					</td>
					<td>
						<label>
							<a href="javascript:dr_dom();" class="btn red btn-xs"><i class="fa fa-refresh"></i> {fc_lang('立即检查')} </a>
						</label>
						<label id="dr_dom_result"></label>
					</td>
				</tr>
				<tr>
					<td>
						<span class="badge badge-success"> {$c+2} </span>
					</td>
					<td>
						{fc_lang('扫描木马文件')}
					</td>
					<td>
						<label>
							<a href="javascript:dr_muma();" class="btn red btn-xs"><i class="fa fa-refresh"></i> {fc_lang('立即检查')} </a>
						</label>
						<label id="dr_muma_result"></label>
					</td>
				</tr>
				</tbody>
			</table>
		</div>
	</div>
</div>
<script type="text/javascript">
{loop $step $id $name}
$.ajax({
    type: "GET",
    url: "{dr_url('check/todo', array('step'=>$id))}&"+Math.random(),
    dataType: "text",
    success: function (html) {
        $("#dr_result{$id}").html(html);
    }
});
{/loop}
function dr_dom() {
    var d = top.dialog({
        title: lang["tips"],
        fixed: true,
        content: '<img src="/statics/js/skins/icons/question.png"> {fc_lang("检测时间可能会很长，确定继续吗？")}',
        okValue: lang['ok'],
        ok: function() {
            var url ="{dr_url('home/dom')}";
            var obj = $('#dr_dom_result');
            obj.html("<img style='height:17px' src='{THEME_PATH}admin/images/mloading.gif' />");
            $.ajax({
                type: "GET",
                url: url,
                dataType: "json",
                success: function (data) {
                    if (data.status == 1) {
                        obj.html('<font color="green">{fc_lang("检测完成，无异常文件")}</font>');
                    } else {
                        obj.html('<a href="javascript:;" onclick="dr_show_file_code(\'{fc_lang('查看文件')}\', \'{dr_url('system/debug_file', array('time'=>SYS_TIME))}\')" style="color:red">'+data.code+'</a>');
                    }
                },
                error: function(HttpRequest, ajaxOptions, thrownError) {

                }
            });
        },
        cancelValue: lang['cancel'],
        cancel: function() {}
    });
    d.show()

}
function dr_muma() {
    var d = top.dialog({
        title: lang["tips"],
        fixed: true,
        content: '<img src="/statics/js/skins/icons/question.png"> {fc_lang("检测时间可能会很长，确定继续吗？")}',
        okValue: lang['ok'],
        ok: function() {
            var url ="{dr_url('home/muma')}";
            var obj = $('#dr_muma_result');
            obj.html("<img style='height:17px' src='{THEME_PATH}admin/images/mloading.gif' />");
            $.ajax({
                type: "GET",
                url: url,
                dataType: "json",
                success: function (data) {
                    if (data.status == 1) {
                        obj.html('<font color="green">{fc_lang("检测完成，尚未发现木马文件")}</font>');
                    } else {
                        obj.html('<a href="javascript:;" onclick="dr_show_file_code(\'{fc_lang('查看文件')}\', \'{dr_url('system/debug_file', array('time'=>SYS_TIME))}\')" style="color:red">'+data.code+'</a>');
                    }
                },
                error: function(HttpRequest, ajaxOptions, thrownError) {

                }
            });
        },
        cancelValue: lang['cancel'],
        cancel: function() {}
    });
    d.show()

}
</script>
{template nfooter.html}